package net.googlecode.harchenko.task3;

import java.math.BigDecimal;

/**
 * Class, that realize Employee.
 */
public class Employee extends Person {

    /**
     * Experience of the Person.
     */
    private BigDecimal experience;
    /**
     * Is salary counts per hour or not.
     */
    private boolean perHour;

    /**
     * Constructor of class Employee.
     *
     * @param firstName  Firstname of the person.
     * @param lastName   Lastname of the person.
     * @param age        Age of the person.
     * @param rate       Rate of the person.
     * @param perHour    Is person's salary counts per hour.
     * @param bonusAmt   Bonus amount of the person.
     * @param experience Experience of the person.
     */
    public Employee(final String firstName, final String lastName, final int age,
                    final BigDecimal rate, final boolean perHour,
                    final BigDecimal bonusAmt, final BigDecimal experience) {
        super(firstName, lastName, age, rate, bonusAmt);
        this.experience = experience;
        this.perHour = perHour;
    }


    /**
     * @return Experience of the person.
     */
    public BigDecimal getExperience() {
        return experience;
    }

    /**
     * Sets experience of the person.
     *
     * @param experience Experience of the person.
     */
    public void setExperience(final BigDecimal experience) {
        this.experience = experience;
    }

    /**
     * @return Is salary of the person counts per hour or not.
     */
    public boolean isPerHour() {
        return perHour;
    }

    /**
     * Sets is salary of the person counts per hour or not.
     *
     * @param perHour Is salary of the person counts per hour or not
     */
    public void setPerHour(boolean perHour) {
        this.perHour = perHour;
    }

    /**
     * Override method for comfortable output.
     *
     * @return Comfortable presentation of object of the class.
     */
    public String toString() {
        return "Employee >> " + getLastName() + " "
                + getFirstName() + ",age:" + getAge();
    }


}
